package hsb.ruoyi.framework.web.service;//package hsb.learn.framework.web.service;
//
//import hsb.learn.system.service.ISysMenuService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.security.core.userdetails.UserDetails;
//import org.springframework.security.core.userdetails.UsernameNotFoundException;
//import org.springframework.stereotype.Service;
//
///**
// * 根基openid获取用户信息
// */
//@Service
//public class UserOpenIdDetailService {
//
////    @Autowired
////    private AppUserMapper userMapper;
//
//    @Autowired
//    private ISysMenuService menuService;
//
//    public UserDetails loadUserByOpenId(String openId) throws UsernameNotFoundException {
//
//        /**
//         * 1.根据openId查询用户信息
//         * 2.获取用户权限，下边例子是根据角色获取，也可以参考ruoyi原来的方式，根据用户id查询如: selectMenuPermsByUserId
//         * 3.创建loginUser对象，并返回即可
//         * */
//
//
//        //根据用户名在数据库中查询用户信息
////        AppUser appUser = userMapper.selectByopenid(openId);
////        Set<String> perms = menuService.selectMenuPermsByRoleName(appUser.getRole());
////        //或者后台配置appuser角色的权限
////        LoginUser loginUser = new LoginUser(appUser.getId(), 100L, appUser, perms);
////        return loginUser;
//
//
//        return null;
//    }
//}